﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Recipients.aspx.cs" Inherits="WebPresentation.Recipients" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('.hiddenField, #MainContent_dtgrecipients th:nth-child(2), #MainContent_dtgrecipients th:nth-child(3)').hide();
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div align="center">
    
    <asp:Label ID="Label10" runat="server" Width="100%" ForeColor="Red" 
        Font-Bold="True"></asp:Label>
    
</div>
    <fieldset>
    <legend>Recipients:</legend>
    <table style="width: 100%;">
        <tr>
            <td align="right" class="style4" width="50%">
                <asp:Label ID="Label1" runat="server" Font-Bold="True" Text=" Document Code:" 
                    Width="150px" style="text-align:left"></asp:Label>
            </td>
            <td align="left" class="style6">
                <asp:DropDownList ID="ddldocid" runat="server" 
                    DataSourceID="DocumentObjectSource" DataTextField="DocCode" 
                    DataValueField="docID">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="DocumentObjectSource" runat="server" 
                    DeleteMethod="Delete" InsertMethod="AddNewDocument" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllDocuments" 
                    TypeName="BusinessLogic.DocumentBO" UpdateMethod="Update">
                    <DeleteParameters>
                        <asp:Parameter Name="docID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="docNumber" Type="Int32" />
                        <asp:Parameter Name="dtID" Type="Int32" />
                        <asp:Parameter Name="docSender" Type="Int32" />
                        <asp:Parameter Name="dateOfReceipt" Type="DateTime" />
                        <asp:Parameter Name="adoptedBy" Type="Int32" />
                        <asp:Parameter Name="inOut" Type="Boolean" />
                        <asp:Parameter Name="shortenedDetail" Type="String" />
                        <asp:Parameter Name="storePath" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="docNumber" Type="Int32" />
                        <asp:Parameter Name="dtID" Type="Int32" />
                        <asp:Parameter Name="docSender" Type="Int32" />
                        <asp:Parameter Name="dateOfReceipt" Type="DateTime" />
                        <asp:Parameter Name="shortenedDetail" Type="String" />
                        <asp:Parameter Name="storePath" Type="String" />
                        <asp:Parameter Name="status" Type="Boolean" />
                        <asp:Parameter Name="docID" Type="Int32" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
        <tr>
            <td align="right" class="style4" width="50%">
                <asp:Label ID="Label2" runat="server" Font-Bold="True" Text="Department:" 
                    Width="150px" style="text-align:left"></asp:Label>
            </td>
            <td align="left" class="style6">
                <asp:DropDownList ID="ddldepid" runat="server" 
                    DataSourceID="DepartmentObjectSource" DataTextField="depName" 
                    DataValueField="depID">
                </asp:DropDownList>
                <asp:ObjectDataSource ID="DepartmentObjectSource" runat="server" 
                    DeleteMethod="DeleteDepartment" InsertMethod="InsertDepartment" 
                    OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllDepartments" 
                    TypeName="BusinessLogic.DepartmentBO" UpdateMethod="UpdateDepartment">
                    <DeleteParameters>
                        <asp:Parameter Name="depID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="depName" Type="String" />
                        <asp:Parameter Name="depCode" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="depName" Type="String" />
                        <asp:Parameter Name="depCode" Type="String" />
                        <asp:Parameter Name="depID" Type="Int32" />
                    </UpdateParameters>
                </asp:ObjectDataSource>
            </td>
        </tr>
    </table>
    <br />
    <div align="center">
        <asp:ImageButton ID="ImageButtonadd" runat="server" 
            ImageUrl="~/Images/addbutton.png" onclick="ImageButtonadd_Click" />
           
        <asp:ImageButton ID="ImageButtonedit" runat="server" 
            ImageUrl="~/Images/editbutton.png" onclick="ImageButtonedit_Click" />
           
        <asp:ImageButton ID="ImageButtonDelete" runat="server" 
            ImageUrl="~/Images/delbutton.png" onclick="ImageButtonDelete_Click" />
    </div>
</fieldset>
<fieldset>
    <legend>Details:</legend>
    <div>
        
        <asp:GridView ID="dtgrecipients" runat="server" CellPadding="4" 
            ForeColor="#333333" GridLines="None" Width="100%" 
            AutoGenerateSelectButton="True" 
            onselectedindexchanged="dtgrecipients_SelectedIndexChanged" 
            AutoGenerateColumns="False" 
            style="text-align: center" DataSourceID="RecipientsObjectSource" 
            AllowPaging="True" AllowSorting="True">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="docID" HeaderText="docID" SortExpression="docID" >
                <ItemStyle CssClass="hiddenField" />
                </asp:BoundField>
                <asp:BoundField DataField="depID" HeaderText="depID" SortExpression="depID" >
                <ItemStyle CssClass="hiddenField" />
                </asp:BoundField>
                <asp:BoundField DataField="DocCode" HeaderText="DocCode" ReadOnly="True" 
                    SortExpression="DocCode" />
                <asp:BoundField DataField="Sender" HeaderText="Sender" 
                    SortExpression="Sender" />
                <asp:BoundField DataField="Recipient" HeaderText="Recipient" 
                    SortExpression="Recipient" />
            </Columns>
            <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
            <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
            <SortedAscendingCellStyle BackColor="#FDF5AC" />
            <SortedAscendingHeaderStyle BackColor="#4D0000" />
            <SortedDescendingCellStyle BackColor="#FCF6C0" />
            <SortedDescendingHeaderStyle BackColor="#820000" />
        </asp:GridView>
        
        <asp:ObjectDataSource ID="RecipientsObjectSource" runat="server" 
            DeleteMethod="DeleteRecipient" InsertMethod="AddNewRecipient" 
            OldValuesParameterFormatString="original_{0}" SelectMethod="GetAllRecipients" 
            TypeName="BusinessLogic.RecipientBO" UpdateMethod="UpdateRecipients">
            <DeleteParameters>
                <asp:Parameter Name="docID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="docID" Type="Int32" />
                <asp:Parameter Name="depID" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="depID" Type="Int32" />
                <asp:Parameter Name="docID" Type="Int32" />
            </UpdateParameters>
        </asp:ObjectDataSource>
        
    </div>
</fieldset>
</asp:Content>

